package cn.xerllent.wxtp.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

import javax.validation.constraints.NotBlank;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import cn.xerllent.common.utils.jsonserializer.LocalDateTimeDeserializer;
import cn.xerllent.common.utils.jsonserializer.LocalDateTimeSerializer;

@Data
@Accessors(chain = true)
@TableName (value="wxtp_dksb")
public class Dksb implements Serializable {

	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;
	
	@TableField(value="corp_id")
	private String corpId;
	
	@TableField(value="req_userid")
	private String reqUserid;
	
	@TableField(value="audit_userid")
	private String auditUserid;
	
	private String comment;
	
	@TableField(value="third_no")
	private String thirdNo;
	
	@TableField(value="template_id")
	private String templateId;

	/**
	 * 0 未提交,1 审批中,2 已通过,3 已驳回,4 已取消
	 * */
	private Integer status; 
	
	@TableField(value="audit_notes")
	private String auditNotes;

	
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//	@JsonFormat(pattern = "EpochSecond", shape = JsonFormat.Shape.NUMBER)
//	@JsonFormat(with = JsonFormat.Feature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)  只对Date TIMESTAMPS对象有效
	@TableField(fill = FieldFill.INSERT)
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
//	@JsonDeserialize(using= LocalDateTimeDeserializer.class)
	@JsonSerialize(using=  LocalDateTimeSerializer.class)
	private LocalDateTime createtime;
	
	@TableField(fill = FieldFill.INSERT_UPDATE,update = "now()")
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//	@JsonFormat(with = JsonFormat.Feature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)
	@JsonSerialize(using=  LocalDateTimeSerializer.class)
	private LocalDateTime updatetime;
	
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonProperty(access = JsonProperty.Access.READ_ONLY)
//	@JsonFormat(with = JsonFormat.Feature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS)
	@JsonSerialize(using=  LocalDateTimeSerializer.class)
	private LocalDateTime audittime;
	
    /** 代课列表 */
    @TableField(exist = false)
    private List<DksbCourse> courses;
	
    public @interface Update {
    }

}